#!/bin/bash

env="$1"
container="$2"
path=$(pwd)
source ${path}/conf/base.sh
#基于Docker搭建Prometheus+Grafana监控平台
function docker_install(){
 local  env=$1 container="$2"
  case $env in
    'install')
        sh ${path}/conf/docker_install.sh  "$env" ;;
    'start')
        sh ${path}/container.sh "$env" "${container}" ;;
    'stop')
        sh ${path}/container.sh "$env" "${container}" ;;
    'restart')
      sh ${path}/container.sh "$env" "${container}" ;;
  esac
}
if [ "$1" != "install" -a "$1" != "start" -a "$1" != "stop" -a "$1" != "restart" ];then
  echo -e "\033[032m 【`hostname` ERROR : $1 】\033[0m"
  log_user
  exit 1
else
 docker_install $env  $container
fi
